package com.raja.servingStation.common.constant;

import java.util.HashMap;
import java.util.Map;

public class Constants{


    public static String OK_MESSAGE ="ok";

    public static String RETURN_OK = "0";

    public static long LOGIN_TIMEOUT = 30*60;

    public static String USER_REDIS_KEY = "system.service.user.userId.";
    public static String USER_REDIS_TOKEN = "system.service.user.token.";
    /**
     * oracle 分页
     */
    //分页的前缀
    public static String page_pre_sql=" SELECT * FROM   ( SELECT A.*, ROWNUM RN   FROM ( " ;
    //分页后缀
    public static String page_end_sql=" ) A    WHERE ROWNUM <= :rowEnd  )   WHERE RN >= :rowStart  ";

    /**
     * mysql分页
     */
    public static String mysql_page_pre_sql = "select * from ( ";

    public static String mysql_page_end_sql = " ) tt limit :limit offset :offset ";
    public static String mysql_page_end_sql2 = " ) tt limit :start, :pagesize ";


    // 每页显示条数
    public static final Integer pageSize = 10;
    public static final Integer currPage = 1;

    public static final String USERSESSIONKEY="wechatRespModel";

    /**
     * 工单状态
     */
    public static final String STATE_NAME_1="待处理";
    public static final String STATE_NAME_2="待审核";
    public static final String STATE_NAME_3="已审核(待评价)";
    public static final String STATE_NAME_4="已评价";


    /**
     * 工单类别
     */
    public static final String ORDER_TYPE_1="1"; //维修工单
    public static final String ORDER_TYPE_2="2"; //首保单


    /**
     * 故障状态
     */
    public static final Integer BLAME_TYPE_6 =6;//雅骏故障";
    public static final Integer BLAME_TYPE_7=7;//"雅骏供应商故障";
    public static final Integer BLAME_TYPE_8=8;//"王牌故障";
    public static final Integer BLAME_TYPE_9=9;//"江铃故障";
    public static final Integer BLAME_TYPE_10=10;//"跨越故障";
    public static final Integer BLAME_TYPE_11=11;//"用户原因";

    /**
     * jwt
     */
    public static final String JWT_ID = "jwt";  //id
    public static final String JWT_SECRET = "7786df7fc3a34e26a61c034d5ec8245d"; //秘钥
    public static final int JWT_TTL = 60*60*1000;  //millisecond 有效时间
    public static final int JWT_REFRESH_INTERVAL = 55*60*1000;  //millisecond
    public static final int JWT_REFRESH_TTL = 12*60*60*1000;  //millisecond // 刷新token后的时间间隔

    /**
     * 数据请求返回码
     */
    public static final int RESCODE_SUCCESS = 1000;				//成功
    public static final int RESCODE_SUCCESS_MSG = 1001;			//成功(有返回信息提示用)
    public static final int RESCODE_EXCEPTION = 1002;			//请求抛出异常
    public static final int RESCODE_NOLOGIN = 1003;				//未登陆状态
    public static final int RESCODE_ERROPARA = 1006;				//无操作权限

    public static final String fanout_raja_repair = "fanout.raja.repair";
    public static final String tbox_exception_url="system/tboxException"; //车辆tbox异常信息的url
    public static final String car_relay_url="system/car/getRelayCars"; //车辆转达共配平台列表
    public static final String set_car_relay_url="system/car/setRelayCar"; //设置车辆是否转发到共配平台
    public static final String get_car_forwardPlatforms_url="system/car/getForwardPlatforms"; //获取车辆转发平台
    public static final String get_car_CurrentTotalKm_url="system/car/getCarCurrentTotalKm"; //获取车辆当前里程

    /**
     * 工单状态
     * 1.待处理
     2.返厂维修
     3.维修终止
     4.维修完成（待评价）
     5.已评价
     */
    public static final Integer ORDER_STATE_1 = 1;
    public static final Integer ORDER_STATE_2 = 2;
    public static final Integer ORDER_STATE_3 = 3;
    public static final Integer ORDER_STATE_4 = 4;
    public static final Integer ORDER_STATE_5 = 5;

    /**
     * 工单来源:1 售后  2维修站
     */
    public static final Integer ORDER_RESOURES_1 = 1;
    public static final Integer ORDER_RESOURES_2 = 2;


    /**
     * 工单日志执行的操作
     执行的操作
     1.创建
     2.委托
     7.评价
     */
    public static final Integer ORDER_LOG_1 = 1;
    public static final Integer ORDER_LOG_2 = 2;
    public static final Integer ORDER_LOG_7 = 7;
    public static Map<Integer,String> map = new HashMap();

    public Constants(){
        map.put(ORDER_LOG_1,"");
        map.put(ORDER_LOG_2,"处理");
        map.put(ORDER_LOG_7,"");
    }

    /**
     * 索赔状态
     *   0 审批中
     1 审批通过
     2 审批驳回
     */
    public static final Integer ORDER_CLAIM_STATE_1 = 1;
    public static final Integer ORDER_CLAIM_STATE_2 = 2;
    public static final Integer ORDER_CLAIM_STATE_0 = 0;

    /**
     * 用户角色
     * 角色
     1.司机
     2.维修人员
     3.负责人
     0 管理者
     */
    public static final Integer USER_ROLE_1 = 1;
    public static final Integer USER_ROLE_2 = 2;
    public static final Integer USER_ROLE_3 = 3;
    public static final Integer USER_ROLE_0 = 0;
}

